package com.framework.common.pojo;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author zhoubb
 * @version V1.0
 * @Date 2020/1/25 13:57
 * @since JDK 1.8
 */

@Data
public class PaginationResult<T> implements Serializable {

    private static final long serialVersionUID = 6325806629126583297L;

    private int               count;

    private List<T> list;

    public int getCount() {
        return this.count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public List<T> getList() {
        return this.list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public PaginationResult() {
    }

    public static <T> PaginationResult<T> newPaginationResult() {
        return new PaginationResult<T>();
    }

    public static <T> PaginationResult<T> newPaginationResult(int count, List<T> list) {
        return new PaginationResult<T>(count, list);
    }

    public PaginationResult(int count, List<T> list) {
        this.count = count;
        this.list = list;
    }

}
